package com.xmut.service.impl;

import com.xmut.mapper.PurchaseRecordMapper;
import com.xmut.pojo.PurchaseRecord;
import com.xmut.service.PurchaseRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PurchaseRecordServiceImpl implements PurchaseRecordService {
    @Autowired
    private PurchaseRecordMapper purchaseRecordMapper;
    @Override
    public List<PurchaseRecord> GetPurchaseRecord(Integer id) {
        return purchaseRecordMapper.GetPurchaseRecord(id);
    }

    @Override
    public void delRecordById(Integer id) {
        purchaseRecordMapper.delRecordById(id);
    }

    @Override
    public List<PurchaseRecord> getAllRecord() {
        return purchaseRecordMapper.getAllRecord();
    }

    @Override
    public List<PurchaseRecord> getAllRecordById(Integer userId) {
        return purchaseRecordMapper.getAllRecordById(userId);
    }

    @Override
    public void InsertPurchaseRecord(PurchaseRecord purchaseRecord) {
         purchaseRecordMapper.InsertPurchaseRecord(purchaseRecord);
    }
}
